# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-click-shell
pkgname=('python2-click-shell' 'python-click-shell')
_pkgname=click-shell
pkgver=2.1
pkgrel=5
pkgdesc='An extension to click that easily turns your click app into a shell utility.'
arch=('any')
url='https://pypi.org/project/click-shell/#files'
license=('BSD')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('dbe435d6a3b51e587fe9890f5edd56e53d0133a4e7b33e634172cad049ed10ee68f29d0d22e2b48f8563d8874ed1c62b1f9377146369b51fb7062ba7652cd11c')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-click-shell() {
  depends=('python2' 'python2-click')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" -O1 --skip-build
}

package_python-click-shell() {
  depends=('python' 'python-click')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" -O1 --skip-build
}

